
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="/static/css/style.css">
</head>
<body>
{#<form action="/form/" method="post" class="smart-green">#}
{#别名的方式,url里面设置好,html里面就不用在意之后路由url里面网页改动#}
<form action="{% url 'go_form' %}" method="post" class="smart-green">
    <h1>留言信息
        <span>请留下你的信息.</span>
    </h1>
    <label>
        <span>姓名 :</span>
        {#        普通取值#}
{#        <input id="name" value="{{ my_message.name }}" type="text" name="name" class="error" placeholder="请输入您的姓名"/>#}
        {#        if取值#}
        <input id="name" value="
        {% if my_message.name == 'joy' %}heh
        {% else %}ming
        {% endif %}
        " type="text" name="name" class="error" placeholder="请输入您的姓名"/>
        <div class="error-msg"></div>
    </label>

    <label>
        <span>邮箱 :</span>
        <input id="email" type="email" value="{{ my_message.email }}" name="email" placeholder="请输入邮箱地址"/>
        <div class="error-msg"></div>
    </label>

    <label>
        <span>联系地址 :</span>
        <input id="address" type="text" value="{{ my_message.address }}" name="address" placeholder="请输入联系地址"/>
        <div class="error-msg"></div>
    </label>

    <label>
        <span>留言 :</span>
        <textarea id="message" name="message"  placeholder="请输入你的建议"></textarea>
        <div class="error-msg"></div>
    </label>
    <div class="success-msg"></div>
    <label>
        <span>&nbsp;</span>
        <input type="submit" class="button" value="提交"/>
    </label>
    {% csrf_token %}
{#    {% csrf_tokenc %}#}
{#    <input type='hidden' name='csrfmiddlewaretoken' value='SfHkbL4feo1G00sJQtbO7TtLN4c2BUwa' />#}
</form>

</body>
</html>